package com.tao.service;

import com.tao.entity.TaoUserEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import lombok.extern.slf4j.Slf4j;

@RestController
@Slf4j
public class MyIndexService {
    @Value("${spring.tao.name}")
    private String name;
    @Value("${spring.tao.age}")
    private String age;

    @Autowired
    private TaoUserEntity taoUserEntity;

    @RequestMapping("/getNameAndAge")
    public String getNameAndAge(){
        return name +":"+ age;
    }

    @RequestMapping("/getNameAgeAddress")
    public String getNameAgeAddress(){
        return taoUserEntity.toString();
    }

    @RequestMapping("/getName")
    public String getName(String name, int age){
        log.info("name,age:"+name,age);
//        log.debug("");
//        try {
//
//        }catch (Exception e){
//            log.error("");
//        }
        return name;
    }
}
